<#assign CACHE_VERSION = "v=v=1.0.7">
<!DOCTYPE html>
<html>
<head>
    <script>
        let base = "${base}";
        let baseFull = "${base}"+"${customPrePath}";
        /**
         * 获取url参数
         */
        function getRequestUrl() {
            var url = location.search;
            var theRequest = new Object();
            if (url.indexOf("?") != -1) {
                var str = url.substr(1);
                strs = str.split("&");
                for(var i = 0; i < strs.length; i++) {
                    theRequest[strs[i].split("=")[0]]=decodeURI(strs[i].split("=")[1]);
                }
            }
            return theRequest;
        }

        let token = getRequestUrl().token;
        if (token == "" || token == null){
            token = window.localStorage.getItem('JmReport-Access-Token');
        }
        window.localStorage.setItem('JmReport-Access-Token',token);
    </script>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>在线设计</title>
    <#include "./common/resource.ftl">
    <link rel="stylesheet" href="${base}${customPrePath}/report/desreport_/corelib/cust.css?${CACHE_VERSION}">
<#--    <link rel="shortcut icon" href="${base}${customPrePath}/report/desreport_/corelib/logo.png?${CACHE_VERSION}" type="image/x-ico">-->
</head>
<body style="background: #ffffff">
<style>

    .ivu-page,
    .ivu-page-prev,
    .ivu-page-next,
    .ivu-select-selection,
    .ivu-select-dropdown,
    .ivu-page.mini .ivu-page-options-elevator input
    {
        background-color: #ffffff;
        color: #515a6e;
    }
    .page{
        display: flex;
        justify-content: center;
        -webkit-box-pack: center;
    }
    .ivu-page-item{
        background-color: #ffffff;
        border: 1px solid rgba(131, 125, 125, 0.5);
    }
    .ivu-page-item-active{
        background-color: white;
        border: 1px solid #409eff;
    }
    .ivu-page-item a{
        margin: 0 6px;
        text-decoration: none;
        color: #515a6e;
    }
    .ivu-page-next a, .ivu-page-prev a {
        font-size: 14px;
        color: #515a6e;
    }
    .ivu-spin-fix{
        background-color: rgba(131, 125, 125, 0.5);
    }
</style>
<style>
    .title{
        font-size: 20px;
        color: #000000;
        text-align: center;
        line-height: 60px;
        font-weight: 500;
    }
    .ivu-layout-sider {
        transition: all .2s ease-in-out;
        position: relative;
        background: #ffffff;
    }
    .ivu-layout {
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        flex-direction: column;
        -webkit-box-flex: 1;
        flex: auto;
        background: #ffffff;
    }
    .ivu-menu-dark.ivu-menu-vertical .ivu-menu-opened .ivu-menu-submenu-title  {
        background: #ffffff;
    }
    .ivu-menu-dark.ivu-menu-vertical .ivu-menu-opened {
        background: #ffffff;
    }
    .ivu-upload-list{
        display: none;
    }
    .ivu-table-tip table tbody tr td{
        background-color: #ffffff;
        color: #000000;
    }
    .ivu-select-dropdown-list .ivu-select-item-focus{
        background: none !important;
    }
    .bounce-enter-active {
        animation: bounce 0.5s;
    }
    .bounce-leave-active {
        animation: bounce 0.5s reverse;
    }
    @keyframes bounce {
        from {right: -35%;}
        to {right:0;}
    }
    .openType-enter-active {
        animation: openType 0.5s;
    }
    .openType-leave-active {
        animation: openType 0.5s reverse;
    }
    @keyframes openType {
        from {left: -35%;}
        to {left:0;}
    }
    .leftopenType-enter-active {
        animation: openType 0.5s;
    }
    .leftopenType-leave-active {
        animation: openType 0.5s reverse;
    }
    @keyframes leftopenType {
        from {margin-left: 0;}
        to {margin-left:300px;}
    }
    .title{
        height: 50px;
        width: 100%;
        padding: 10px;
        display: flex;
        align-items: center;
        font-size: 16px;
        font-weight: bold;
    }
    .form{
        margin-left:20px;
    }
    .endTime{
        margin-left:20px;
    }

</style>
<!--引入自定义组件-->
<#include "./template/list.ftl">
<div id="app">
    <div class="title" >统计任务配置</div>
    <div class="form">
            <i-form :model="formItem" :label-width="120">
                <form-item label="统计任务名称：">
                    <i-row>
                        <i-col span="6">
                            <i-input v-model="formItem.name" placeholder="请输入"></i-input>
                        </i-col>
                    </i-row>
                </form-item>
                <form-item label="统计任务编号：">
                    <i-row>
                        <i-col span="5">
                            <i-input v-model="formItem.number" placeholder="请输入"></i-input>
                        </i-col>
                    </i-row>
                </form-item>
                <form-item label="选择脚本：">
                    <i-row>
                        <i-col span="3">
                            <i-select v-model="formItem.script" placeholder="请选择" >
                                <i-option value="beijing">XXXXX</i-option>
                                <i-option value="shanghai">XXXXX</i-option>
                                <i-option value="shenzhen">XXXXX</i-option>
                            </i-select>
                        </i-col>
                    </i-row>
                </form-item>
                <form-item :label="item.lable" v-for="item in formLable" v-if="formItem.script?true:false" >
                    <i-row>
                        <i-col span="3">
                            <i-select v-model="formItem.PlantAndStation" placeholder="请选择">
                                <i-option value="beijing" v-for="option in item.optionList">{{option.name}}</i-option>
                            </i-select>
                        </i-col>
                    </i-row>
                </form-item>
                <form-item label="时间间隔">
                    <Row>
                        <Col span="11">
                            <Date-picker type="time" placeholder="时间间隔" v-model="formItem.offsetTime"></Date-picker>
                        </Col>
                    </Row>
                </form-item>
                <form-item label="开始时间">
                    <Row>
                        <Col span="10">
                        <Date-picker type="date" placeholder="开始时间" v-model="formItem.startTime"></Date-picker>
                        </Col>

                        <Col span="10" offset="4" i-class="endTime">
                            <span>结束时间</span>
                            <Time-picker type="time" placeholder="结束时间" v-model="formItem.endTime"></Time-picker>
                        </Col>
                    </Row>
                </form-item>

            </i-form>
    </div>
    <div>
        <#include "./common/frequency.ftl">
    </div>
</div>
<script>
    var BASE_URL="${base}"+"${customPrePath}";
    var currentPage = new Vue({
        el: '#app',
        data: {
            formItem: {
                name: '',
                number: '',
                type: 'male',
                script: "",
                endTime: "",
                startTime: '',
                offsetTime: '',
                attribute: "",
                equipment: ''
            },
            columns: [
                {
                    title: '统计任务名称',
                    key: 'name'
                },
                {
                    title: '统计任务编号',
                    key: 'age'
                },
                {
                    title: '处理方式',
                    key: 'address'
                },
                {
                    title: '使用脚本名称',
                    key: 'age'
                },
                {
                    title: '任务启用状态',
                    key: 'type'
                },
                {
                    title: 'Action',
                    slot: 'action',
                    width: 150,
                    align: 'center'
                }
            ],
            tableData: [
                {
                    name: 'John Brown',
                    age: 18,
                    address: 'New York No. 1 Lake Park',
                    date: '2016-10-03'
                },
                {
                    name: 'Jim Green',
                    age: 24,
                    address: 'London No. 1 Lake Park',
                    date: '2016-10-01'
                },
                {
                    name: 'Joe Black',
                    age: 30,
                    address: 'Sydney No. 1 Lake Park',
                    date: '2016-10-02'
                },
                {
                    name: 'Jon Snow',
                    age: 26,
                    address: 'Ottawa No. 2 Lake Park',
                    date: '2016-10-04'
                }
            ],
            formLable:[{lable:"所属厂站过滤",optionList:[{name:"achang"},{name:"b站"},{name:"c站"}]},{lable:"所属厂站过滤",optionList:[{name:"achang"},{name:"b站"},{name:"c站"}]},{}]
        },
        // computed: {
        //     menuitemClasses: function () {
        //         return [
        //             'menu-item',
        //             this.isCollapsed ? 'collapsed-menu' : ''
        //         ]
        //     }
        // },
        mounted:function(){
            this.token = token;
            console.log("list_mount--------------",this.token);
            this.uploadHeader = {"X-Access-Token":this.token};
            this.actionUrl=BASE_URL+"/report/putFile";
        },
        methods: {

        },
    })
</script>
<#include "./common/tj.ftl">
</body>
</html>
